$(
function(){
    $('#add').click(
        function(){
            var tid=$('#curType').val();
            self.location=baseurl+"admin/sites/add/"+tid; 
            return false;    
        });
         
    $('#delm').click(function(){
        var idstr='';
        $('input:[checked=true]').each(
            function(){
                idstr+=$(this).val()+',';
            }
        );
        self.location = baseurl + "admin/sites/delm/"+idstr;
        return false;
    });
    
    $('#move').click(function(){
         var idstr='';
        $('input:[checked=true]').each(
            function(){
                idstr+=$(this).val()+',';
            }
        );
        idstr=idstr.substr(0,idstr.length-1);
        var tid=$('#tagType').val();
        self.location = baseurl + "admin/sites/moveto/"+idstr+'/'+tid;
        return false;
    });
    
    $('#curType').change(
        function(){
            self.location=baseurl+'admin/sites/index/'+$(this).val();
        }
    );
});